<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="shortcut icon" href="/static/pic/favicon.png">
    <title>插入数据</title>
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/static/blog/css/blog_base.css">
</head>
<body>
<div class="container-fluid">
    <div class="rov">
        <div class="col-md-6 col-md-offset-3">
            <h1>
                {% csrf_token %}
                <a id="inster">点击插入测试数据</a>
            </h1>
        </div>
    </div>
</div>

</body>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="/static/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/session.js"></script>
<script>
    $('#inster').click(function () {
        $(this).html('请耐心等待,5s后将会跳转...');
        $.ajax({
            url:'',
            type:'post',
            data:{
                'csrfmiddlewaretoken':$('[name="csrfmiddlewaretoken"]').val(),
            },
            success:function (response) {
                if(response.state){
                    window.location.href='/index/'
                }else{
                    $(this).text('操作失败');
                }
            }
        })
    })
</script>
</html>